<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 空白页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico">  <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <link href="__STATIC__/layout/css/plugins/summernote/summernote.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/summernote/summernote-bs3.css" rel="stylesheet">
     <link rel="stylesheet" type="text/css" href="__STATIC__/layout/css/plugins/webuploader/webuploader.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/layout/css/demo/webuploader-demo.css">
    <!-- jqgrid-->
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
</head>

<body style="color:#333;padding:3px;" class="x_sorll">
    <!-- 标题 -->
    <div class="page-heade">
      <h2 class="title_color text-center">常规促销申请</h2>
    </div>
    <!-- 标题 -->
    <div class="form-inline">
    <form action="" id="f1">
    <input type="hidden" name="aid" value="{$aid}"/>
      <table class="tab-content table-bordered table" border="1">
      <tr>
        <td><button class="btn-info btn" onclick="wanzheng({$aid})" type="button" style="margin-right: 15px">导出Excel完整版</button><button class="btn btn-info" type="button" onclick="shuju({$aid})">导出数据</button></td>
      </tr>
      </table>
    
      <table class="table table-bordered bud_hei">
       {if condition="$hasfk eq 1"}
          <tr class="warning">
            <td colspan="8">
            反馈单号:
            {volist name="fk" id="f"}
              <a onclick="feed({$f.id},{$aid})">{$f.no}</a>&nbsp;
            {/volist}
            </td>
          </tr>
       {/if}
       {if condition="$hashx eq 1"}
          <tr class="warning">
            <td colspan="8">
            核销单号:
            {volist name="hx" id="h"}
              <a onclick="hede({$h.id},{$aid})">{$h.no}</a>&nbsp;
            {/volist}
            </td>
          </tr>
       {/if}
         <tr>
             <td style="min-width: 120px;width: 120px"><label for="" class="form-label" >主题</label></td>
             <td colspan="7" class="font-bold">{$apply.title}</td>
          </tr>
          <tr>
             <td style="min-width: 120px;width: 120px"><label for="" class="form-label" >编号</label></td>
             <td>{$apply.no}</td>
             <td style="min-width: 120px;width: 120px"><label for="" class="form-label" >原申请编号</label></td>
             <td>{if condition="$apply.yuanno neq ''"}<a class="J_menuItem" title="{$apply.yuanno}" href="{:url('apply_de')}?aid={$apply.yuanid}">{$apply.yuanno}</a>{else/}无 {/if}</td>
             <td style="min-width: 120px;width: 120px"><label for="" class="form-label" >修改后编号</label></td>
              <td>{if condition="$apply.nextno neq ''"}<a class="J_menuItem" title="{$apply.nextno}" href="{:url('apply_de')}?aid={$apply.nextid}">{$apply.nextno}</a>{else/}无 {/if}</td>
             <td style="min-width: 120px;width: 120px"><label for="" class="form-label" >状态</label></td>
             <td>{$apply.zhuangtai}</td>
          </tr>
           <tr>
           <td style="min-width: 120px;width: 120px"><label for="" class="form-label" >申请时间</label></td>
             <td>{$apply.created_on}</td>
             <td style="min-width: 120px;width: 120px"><label for="" class="form-label" >申请人</label></td>
             <td><a href="javascript:;">{$apply.cname}({$apply.job_name})</a></td>
             <td style="min-width: 120px;width: 120px"><label for="" class="form-label" >申请人部门</label></td>
             <td colspan="3">{$apply.de_name}</td>
             
            
          </tr>
         
      </table>
       <table class="table table-striped row-margin-top table-bordered text-center bud_hei">
         <thead>
          <tr class="info">
             <th class="text-center" rowspan="2">状态</th>
             <th class="text-center" rowspan="2">审批人</th>
             <th class="text-center" rowspan="2">序号</th>
             <th class="text-center"  rowspan="2">明细编号</th>
             <th class="text-center" colspan="2">供应商信息</th>
             <th class="text-center" colspan="13">活动信息详细</th>
             <th class="text-center" colspan="9">费用详情</th>
             <th class="text-center" colspan="7">销量详情</th>
           
            <th class="text-center" rowspan="2">项目描述</th>
            <th class="text-center" rowspan="2">备注</th>
          </tr>
           <tr class="info">
           <th class="text-center">供应商编码</th>
            <th class="text-center">供应商名称</th>
            <th class="text-center">分区</th>
            <th class="text-center">省份</th>
            <th class="text-center">城市</th>
            <th class="text-center">经销商</th>
            <th class="text-center">系统</th>
            <th class="text-center">网点</th>
            <th class="text-center">品牌</th>
            <th class="text-center">品类</th>
            <th class="text-center">系列</th>
            <th class="text-center">原活动<br/>执行时间</th>
            <th class="text-center">移动后<br/>执行时间</th>
            <th class="text-center">异动原因</th>
            <th class="text-center">取消原因</th>

            <th class="text-center">已核销金额（元）</th>
            <th class="text-center">二级费用科目</th>
            <th class="text-center">三级费用科目</th>
            <th class="text-center">未税费用金额（元）<br/>（申请金额/批复金额）</th>
             <th class="text-center">税率</th>
             <th class="text-center">是否增值税<br/>可抵扣</th>
             <th class="text-center">含税费用金额</th>
            <th class="text-center">实际投入金额</th>
            <th class="text-center">费用支付方式</th>

            <th class="text-center">预计销量</th>
            <th class="text-center">预计费用率</th>
            <th class="text-center">实际销量</th>
            <th class="text-center">2SR基准销量</th>
            <th class="text-center">基准销量</th>
            <th class="text-center">新增销量</th>
            <th class="text-center">预计ROI</th>
        </tr>
         </thead>
         <tbody>
          {volist name="applyde" id="vo1" key="j"}
             <tr class="text-center" {if condition="$vo1.tag eq 1"} style="color:green;" {/if}>
                  <td>
                    {switch name="$vo1.tag" }
                         {case value="0"}
                          正常
                        {/case}
                         {case value="1"}
                          异动
                        {/case}
                         {case value="2"}
                          取消
                        {/case}
                    {/switch}
                  </td><td>无</td><td>{$j}{if condition="$vo1.is_bu eq 1"}<span class="colorRed duigou" title="此单申请时间在活动开始时间之后">补单</span>{/if}</td>
                   <td>{$vo1.no}-{$vo1.detail_no}<a href="{:url('mingxijuece')}?did={$vo1.id}" title="决策依据" class="J_menuItem" ><span style="display: none;">决策依据</span><span class="glyphicon glyphicon-zoom-in fangda" aria-hidden="true" style="display: inline-block;"></span></a></td><td>{$vo1.gys_no}</td><td>{$vo1.gys_name}</td>
                    <td>{$vo1.fenqu}</td><td>{$vo1.sheng}</td><td>{$vo1.shi}</td><td>{$vo1.jxs}</td><td>{$vo1.system}</td><td>{$vo1.net}</td>
                    <td>{$vo1.brand}</td><td>{$vo1.category}</td><td>{$vo1.series}</td>
                     {if condition="$vo1.tag eq 1"}
                       <td>{$vo1.yuanstart}<br>{$vo1.yuanend}</td> <td>{$vo1.start_time} <br>{$vo1.end_time}</td>
                      <td>{$vo1.biandongyuanyin}</td><td></td>
                    {else/}
                        <td>{$vo1.start_time} <br>{$vo1.end_time}</td> <td>&nbsp;</td>
                        <td></td><td>{if condition="$vo1.tag eq 2"}{$vo1.biandongyuanyin}{/if}</td>
                       
                    {/if}
                   <td class="num2">{$vo1.hexiao}</td><td>{$vo1.kemu2}</td><td>{$vo1.kemu3}</td>
                        <td><span class="num2">{$vo1.zonge}</span>/<span class="num2">{$vo1.pifuzonge}</span></td>
                        <td><span class="num2">{$vo1.shuilv}</span>%</td> <td>{if condition="$vo1.dikou eq 0"}否{else/}可{/if}</td>
                        <td class="num2">{$vo1.hanshui}</td><td class="num2">{$vo1.hanshui}</td><td>{$vo1.zffs}</td>
                        <td class="num2">{$vo1.zong_xiaoliang}</td><td><span class="num2">{$vo1.yujifeiyonglv}</span>%</td> <td class="num2">{$vo1.fankuixiaoliang}</td><td>0.00</td>
                        <td class="num2">{$vo1.jizhun_xiaoliang}</td> <td class="num2">{$vo1.xinxiaoliang}</td><td><span class="num2">{$vo1.yujiroi}</span>%</td>
                        <td><a onclick="tanchuan({$vo1.id})">点击查看</a></td><td>{$vo1.remark}</td>
             </tr>

          {/volist}
          </tbody>
          <tfoot>
               <tr class="font-bold text-right">
                 <td colspan="19">总计</td>
                   <td class="num2">{$all.0.hexiaos}</td><td></td><td></td><td><span class="num2">{$all.0.zonges}</span>/<span class="num2">{$all.0.pifuzonges}</span></td>
                   <td></td><td></td><td class="num2">{$all.0.hanshuis}</td><td class="num2">{$all.0.hanshuis}</td><td></td><td class="num2">{$all.0.zong_xiaoliangs}</td>
                   <td><span class="num2">{$all.0.yujifeiyonglvs}</span>%</td><td class="num2">{$all.0.fankuixiaoliangs}</td><td>0.00</td><td class="num2">{$all.0.jizhun_xiaoliangs}</td><td class="num2">{$all.0.xinxiaoliangs}</td><td><span class="num2">{$all.0.yujirois}</span>%</td><td></td><td></td>


              </tr>

          </tfoot>
      
      </table>
        <table class="table table-bordered" style="margin:0;padding: 0">
          <tr>
           <td class="font-bold">本申请中包含<span>{$contfenqu}</span>个分区，{$contbrand}个品牌,{$contgys}个供应商,{$contfeiyong}个三级费用科目  
      其中{volist name="feiyongs" id="fys"}{$fys.title}:<span class="num2">{$fys.kezonge}</span>（元）&nbsp;&nbsp; {/volist}
      总预计未税费用:<span class="num2">{$contzonge}</span>  （元）&nbsp;&nbsp;      总预计销售量：<span class="num2">{$contzongxiao}</span>（元）
      预计费用率:<span class="num2">{$all.0.yujifeiyonglvs}</span>% &nbsp;&nbsp; 预计roi：<span class="num2">{$all.0.yujirois}</span>%
            </td>
          </tr>
      </table>
       <table class="table table-bordered text-left bud_hei">
            <tr class="info">
                <th class="text-left font-bold">审批意见</th>
            </tr>
            {volist name="logs" id="l"}
          <tr>
              <td>{$l.USERNAME} 审批动作：{$l.MEMO}；审批意见：{if $l.COMMENTS}{$l.COMMENTS}{else/}无{/if}(审批时间：{$l.ACTIONTIME})</td>
          </tr>
          
          {/volist}
      </table>
        {if $apply.annex_id}
            <table class="table-bordered table" style="margin-top:0">
            <tr>
              <td>附件列表</td>

            </tr>
            <tr><td>
               {volist name="fujian" id="f"}
                    <a onclick="down({$f.id})">{$f.file_name}</a>&nbsp;&nbsp;
                  {/volist}
            </td></tr>
              </table>
               
        {/if}
          <div class="row sub_btn" style="width:100%;text-align:center;padding: 20px 0">
        <input type="hidden" id="nodeKey" name="nodeKey"/>
                  <input type="hidden" id="selectId" name="selectId"/>
                  <input type="hidden" id="selectName" name="selectName"/>
                    {volist name="btn.nextNodes" id="b"}
                      {if $b.nodeName=='结束'}
                      <input type="button" class="btn-danger btn" onclick="zuofei('{$b.nodeKey}','{$b.selectId}','{$b.selectName}')" value="点此作废"/>
                      
                      {/if}
                    {/volist}
    </div>
</form>
    </div>
    {if condition="$apply.tag eq 1"}
       <div class="SuccessImg font-bold">
        申报已异动
      </div>
    {elseif condition="$apply.tag eq 2"/}
     <div class="applyImg font-bold">
        申报已取消
      </div>

    {elseif condition="$apply.is_shengxiao eq 1"/}
       <div class="applyImg font-bold">
        申报已生效
      </div>
      {if condition="$apply.is_hexiao neq 0"}
       <div class="SuccessImg font-bold">
        申报已核销
      </div>
      {elseif condition="$apply.is_fankui neq 0"/}
       <div class="SuccessImg font-bold">
        申报已反馈
      </div>
      {/if}
    {/if}
    {if $apply.state==8}
      <div class="applyImg font-bold">
        申报已作废
      </div>
    {/if}
{if $apply.state==9}
      <div class="applyImg font-bold">
        申报已否决
      </div>
    {/if}
    <!--
    <div class="applyImg font-bold">
        申报已生效
      </div>-->
    <!-- 全局js -->
   <!-- 全局js -->
    <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
   <script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
     <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
         <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="__STATIC__/layout/js/plugins/summernote/summernote.min.js"></script>
<script src="__STATIC__/layout/js/plugins/summernote/summernote-zh-CN.js"></script>
<script src="__STATIC__/layout/js/plugins/suggest/bootstrap-suggest.min.js"></script>
 <script src="__STATIC__/layout/js/common.js"></script>
  <script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
   <script src="__STATIC__/layout/js/contabs_sub.js"></script>
  <script type="text/javascript">
   var fr={$from};
      function zuofei(nodeKey,selectId,selectName){
  $("#nodeKey").val(nodeKey)
  $("#selectId").val(selectId)
  $("#selectName").val(selectName)
   $.ajax({
          cache: true,
          type: "POST",
          url:"{:url('ydzuofeichuli')}",
          data:$('#f1').serialize(),// 你的formid
          async: false,
          error: function(request) {
            alert("Connection error");
          },
          success: function(data) {
           // alert(data);
            //var res=JSON.parse(data);
                    var res1=JSON.parse(data);
                            if(res1["state"]==1){
                              swal({
                                title: "完成",
                                text: "操作已成功",
                                type: "success"
                                },function(){
                                   if(fr==1)
                                        location.href="{:url('index')}"
                                    else
                                        location.href="{:url('Workflowdb/index')}"
                                  //parent.layer.close(parent.layer.getFrameIndex(window.name))
                                  //
                                });

                          }else{
                            swal({
                            title: "错误",
                            text:  res1["msg"],
                            type: "warning"
                            });
                          } 
          }
        });
}
  function down(id){
    window.open("{:url('download_fujian')}?fid="+id)
  }
  function hede(hid,aid){
   location.href="{:url('apCostVerifyDetail')}?hid="+hid+"&aid="+aid; 
  }
  function feed(fkid,aid){
    location.href="{:url('apFeedDetail')}?fkid="+fkid+"&aid="+aid;
  }
   function shuju(aid){
    location.href="{:url('shuju')}?aid="+aid;

}
  function wanzheng(aid){
    location.href="{:url('wanzheng')}?aid="+aid;

}
    function tanchuan(did){
        $.post("{:url('getdes')}",{did:did},function(re){

            var data=JSON.parse(re);
            if(data["state"]==1){
                 parent.layer.open({
                type: 1,
                skin: 'layui-layer-demo', //样式类名
                closeBtn: false, //不显示关闭按钮
                shift: 2,
                shadeClose: true, //开启遮罩关闭
                content: data["msg"]
                });
            }else{
                   parent.layer.open({
                type: 1,
                skin: 'layui-layer-demo', //样式类名
                closeBtn: false, //不显示关闭按钮
                shift: 2,
                shadeClose: true, //开启遮罩关闭
                content: '系统繁忙请稍后再试'
                });
            }
        })
        
    }
      $(".num2").each(function(){
                if(!isNaN(parseFloat($(this).html())))
                 var num=parseFloat($(this).html()).toFixed(2);
                else
                    var num="0.00";
                $(this).html(num);
            })
            </script>
      
 
</body>

</html>
